+2006-01-08 Matthias Clasen <mclasen@redhat.com>
+
+ * gdk/gdkregion-generic.c (miRegionCopy): Fix this for the
+ single-rectangle case. (#326127, Benjamin Berg)
+ (gdk_region_copy): Use miRegionCopy() here.
+
2006-01-07 Matthias Clasen <mclasen@redhat.com>
Fix actiongroup-action interaction that relied on
+2006-01-08 Matthias Clasen <mclasen@redhat.com>
+
+ * gdk/gdkregion-generic.c (miRegionCopy): Fix this for the
+ single-rectangle case. (#326127, Benjamin Berg)
+ (gdk_region_copy): Use miRegionCopy() here.
+
2006-01-07 Matthias Clasen <mclasen@redhat.com>
Fix actiongroup-action interaction that relied on
g_return_val_if_fail (region != NULL, NULL);
- temp = g_slice_new (GdkRegion);
+ temp = gdk_region_new ();
- temp->numRects = region->numRects;
- temp->extents = region->extents;
- temp->size = region->numRects;
-
- if (region->numRects == 1)
- temp->rects = &temp->extents;
- else
- {
- temp->rects = g_new (GdkRegionBox, region->numRects);
- memcpy (temp->rects, region->rects, region->numRects * sizeof (GdkRegionBox));
- }
+ miRegionCopy (temp, region);
return temp;
}
}
static void
-miRegionCopy(GdkRegion *dstrgn, GdkRegion *rgn)
+miRegionCopy (GdkRegion *dstrgn,
+ GdkRegion *rgn)
{
if (dstrgn != rgn) /* don't want to copy to itself */
{
if (dstrgn->size < rgn->numRects)
{
- dstrgn->rects = g_renew (GdkRegionBox, dstrgn->rects, rgn->numRects);
+ if (dstrgn->rects != &dstrgn->extents)
+ g_free (dstrgn->rects);
+
+ dstrgn->rects = g_new (GdkRegionBox, rgn->numRects);
dstrgn->size = rgn->numRects;
}
+
dstrgn->numRects = rgn->numRects;
dstrgn->extents = rgn->extents;